{% extends 'layout.html' %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css' %}">
{% endblock %}

{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">添加用户</h3>
            </div>
            <div class="panel-body">
                <form method="post">
                    {% csrf_token %}

                    <div class="form-group">
                        <label>姓名</label>
                        <input type="text" class="form-control" placeholder="姓名" name="user"/>
                    </div>

                    <div class="form-group">
                        <label>密码</label>
                        <input type="text" class="form-control" placeholder="密码" name="pwd"/>
                    </div>

                    <div class="form-group">
                        <label>年龄</label>
                        <input type="text" class="form-control" placeholder="年龄" name="age"/>
                    </div>

                    <div class="form-group">
                        <label>账户余额</label>
                        <input type="text" class="form-control" placeholder="账户余额" name="ac"/>
                    </div>

                    <div class="form-group">
                        <label>入职时间</label>
                        <input id="dt" autocomplete='False' type="text" class="form-control" placeholder="入职时间"
                               name="ctime"/>
                    </div>

                    <div class="form-group">
                        <label>性别</label>
                        <label>
                            <select class="form-control" name="gd">
                                {% for itme in gender_choices %}
                                    <option value="{{ itme.0 }}">{{ itme.1 }}</option>
                                {% endfor %}
                            </select>
                        </label>
                    </div>

                    <div class="form-group">
                        <label>部门</label>
                        <label>
                            <select class="form-control" name="dp">
                                {% for itme in depart_list %}
                                    <option value="{{ itme.id }}">{{ itme.title }}</option>
                                {% endfor %}
                            </select>
                        </label>
                    </div>

                    <button type="submit" class="btn btn-primary">提 交</button>
                </form>
            </div>
        </div>
    </div>
{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-datepicker/js/bootstrap-datepicker.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.js' %}"></script>
    <script>
        $(function () {
            $('#dt').datepicker({
                format: 'yyyy-mm-dd',
                startDate: '0',
                language: 'zh-CN',
                autoclose: true,
            });
        });
    </script>
{% endblock %}
